<?=isset($header) ? $header : ''?>
<div id="content">
	<div class="form_style">
		<div class="title">
			<h5>權限編輯</h5>
		</div>
		<form method="post" action="/role/purview_submit" id="userinfo">
			<table>
			<tbody><tr>
				<td width="100"><input type="hidden" value="2" id="role_id">角色名稱：</td>
				<td><?=$role->role_name?></td>
			</tr>
			<?
			foreach($system_module as $sm_key=>$sm_val){
			?>
			<tr class="checkbox">
				<td>
					<input type="checkbox"  value="<?=$sm_val->mark?>" id="<?=$sm_val->mark?>" onclick="selectCheckBox('<?=$sm_val->mark?>')" name="system_module" id="system_module"><?=$sm_val->name?>
				</td>
				<td>
					<ul>
						<?
							foreach($purview[$sm_val->system_module_id] as $p_key=>$p_val){
						?>
						<li><input type="checkbox" class="usermgr" value="<?=$p_val->mark?>" name="purview[]" <? if(strstr($role->purview,",".$p_val->mark.",")) echo "checked";?> id="<?="purview_".$sm_val->mark?>"><?=$p_val->name?></li>
						<?
							}	
						?>
					</ul>
				</td>
			</tr>
			<?
			}	
			?>
			<tr>
			<td>
				<a onclick="allSelected();">全選</a>\<a onclick="allInvertSelection();">反選</a>
			</td>
			<td class="last_save">
				<input type="hidden" id="role_id" name="role_id" value="<?=$role->role_id?>">
				<input type="submit" value="確定" class="input_background">
				<input type="reset"  value="清空" class="input_background"></td>
			</tr>
			</tbody>
			</table>
		</form>
	</div>
</div>
<?=isset($footer) ? $footer : ''?>